/****************************************************************************
**
** Copyright (C) .  All rights reserved. 
**
****************************************************************************/
/*!
 * \file
 * def_ddraw.h
 */
#ifndef DEF_DDRAW_H
#define DEF_DDRAW_H

#include <ddraw.h>

//==========================================================================================//
//																							//
// Definition																				//
//																							//
//==========================================================================================//

#define MAKEFOURCC(ch0, ch1, ch2, ch3)  ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
#define DX_SAFE_RELEASE(p)				{ if (p) { (p)->Release(); (p) = NULL; }}

#define MAX_SECTION						4
#define LOGO_WIDTH						352
#define LOGO_HEIGHT						240

#define MAX_WIDTH						1280
#define MAX_HEIGHT						720

#define	WM_DXS_MESSAGE					WM_USER+99

#define ZOOM_MIN				0x40		/**< Mininum zoom value in display 	*/
#define ZOOM_MAX				0x400		/**< Maximum zoom value in display 	*/
#define ZOOM_DEFAULT			0x100		/**< Default zoom value in display 	*/
#define ZOOM_UNIT				0x10		/**< Incease or decrease zoom value by this unit value 	*/

/*!
 * Global enumerator defined PIP image position
 */
enum _POS
{
	POS_TOP_LEFT = 0,
	POS_TOP_RIGHT,
	POS_BOTTOM_LEFT,
	POS_BOTTOM_RIGHT,
	MAX_PIP_POS,
};


enum LAYOUT
{
	LAYOUT_1X1,
	LAYOUT_2X1,
	LAYOUT_2X2,
	LAYOUT_4X2,
	LAYOUT_4X4,	
	LAYOUT_COUNT
};

enum PIXELFORMAT
{	
	PF_YUY2	= 0,
	PF_YV12,
	PF_UYVY,
	PF_RGB32,
	PF_RGB24,
	PF_RGB16,
	PF_COUNT
};

enum _DXS_MSG
{
	DXS_MSG_LCLICK	= 1234,
	DXS_MSG_LDBCLICK,
	DXS_MSG_RCLICK,
	DXS_MSG_DROP,
	DXS_MSG_NONE_DROP,
	DXS_MSG_DRAG,
	DXS_MSG_LDOWN,
	DXS_MSG_MOUSEMOVE,
	DXS_MSG_LUP,
	DXS_MSG_RESET_DISPLAY,
	DXS_MSG_MOUSEWHEEL,
};

/*!
 * Global enumerator defined image format
 */
enum _TAG_VIDEO_FORMAT
{
	FMT_YUV422PK_UU,	//!< YUV422 packed mode
	FMT_YUV422PK_UD,	//!< YUV422 packed mode with upside down
	FMT_YUV422PL_UU,	//!< YUV422 planar mode
	FMT_YUV422PL_UD,	//!< YUV422 planar mode with upside down
	FMT_RGB,			//!< RGB 32bit mode
};

/*!
 * Global enumerator define image ratio
 */
enum _TAG_RATIO
{
	RATIO_DEFAULT = 0,	//!< Default ratio, it is the same as RATIO_ORIGINAL
	RATIO_16_TO_09,		//!< ratio of 16:9
	RATIO_04_TO_03,		//!< ratio of 4:3
	RATIO_ORIGIANL,		//!< ratio depend on image width and height
	RATIO_KEEP = 0x10000	//!< keep the video image own ratio
};

typedef struct _OFFSCREEN_INFO
{
	DWORD			dwWidth;
	DWORD			dwHeight;
	PIXELFORMAT		pixelFormat;
} OFFSCREEN_INFO, *POFFSCREEN_INFO;

typedef struct _WND_WHEEL_INFO
{
	UINT nFlags;
	short zDelta;
	CPoint pt;
	int nID;
} ST_WHEEL_INFO, *LPST_WHEEL_INFO;


#endif // DEF_DDRAW_H